package com.sali.utils.exception;


import com.sali.utils.result.IResultCode;

/**
 * 自定义参数检验异常
 */
public class ValidationException extends RuntimeException {

    private final Integer code;
    private final String msg;



    public ValidationException(IResultCode iResultCode) {
        super(iResultCode.getMsg());
        this.code = iResultCode.getCode();
        this.msg = iResultCode.getMsg();
    }

    public ValidationException(int code, String message) {
        super(message);
        this.code = code;
        this.msg = message;
    }


    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
